package com.prg.model.base;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * AuthMenu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "AUTH_MENU", schema = "SSHE")
public class AuthMenu implements java.io.Serializable {

	// Fields

    private String pid;
	private String id;

	private AuthMenu authMenu;
    private String name;      //资源名称
    private String url;      //资源路径
    private String description;   //资源描述
    private String iconscls;//图标
    private String iconCls;//图标
    @Transient
    public String getPid() {

        return pid;
    }

    public void setPid(String pid) {
        this.pid =pid;


    }

    public String getIconCls() {
        return iconCls;
    }

    public void setIconCls(String iconCls) {
        this.iconCls = iconCls;
    }

    private Integer seq;   //顺序

	private Set<AuthMenu> authMenus = new HashSet<AuthMenu>(0);

	// Constructors

	/** default constructor */
	public AuthMenu() {
	}



	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false, length = 100)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PID")
	public AuthMenu getAuthMenu() {
		return this.authMenu;
	}

	public void setAuthMenu(AuthMenu authMenu) {
		this.authMenu = authMenu;
	}

	@Column(name = "NAME", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "ICONSCLS", length = 100)
	public String getIconscls() {
		return this.iconscls;
	}

	public void setIconscls(String iconscls) {
		this.iconscls = iconscls;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "authMenu")
	public Set<AuthMenu> getAuthMenus() {
		return this.authMenus;
	}

	public void setAuthMenus(Set<AuthMenu> authMenus) {
		this.authMenus = authMenus;
	}

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }



    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

}